﻿using System.Collections.Generic;
using System.Data.Entity;

namespace WebBarracoDoSom.Models
{
    public class UsuarioInitializer : DropCreateDatabaseAlways<UsuarioDBContext>
        //DropCreateDatabaseIfModelChanges<UsuarioDBContext>
    {
        protected override void Seed(UsuarioDBContext context)
        {
            var users = new List<Usuario> {  new Usuario {  ID = 1,
                                                            Nome = "admin", 
                                                            Email="admin",
                                                            Telefone="0",
                                                            CPF = "0", 
                                                            RG = 0, 
                                                            Senha="admin",
                                                            Prioridade = 0}};

            users.ForEach(u => context.Usuarios.Add(u));
        }
    }
}